<ion-view view-title="{{'TRANSACTIONS_TITLE' | translate}}">
  <ion-nav-bar class="bar-assertive">
    <ion-nav-back-button></ion-nav-back-button>
  </ion-nav-bar>
  <!--ion-nav-buttons side="left">
    <button class="button button-clear" on-touch="goBack()">
      <i class="icon ion-ios-arrow-back"></i>
    </button>
  </ion-nav-buttons-->  
  <ion-nav-buttons side="right">
    <button class="button button-clear" ng-hide="transactions.length == 0" on-touch="deleteAllTransactions()">
      <i class="icon ion-ios-trash-outline"></i>
    </button>
  </ion-nav-buttons>  
  <ion-header-bar align-title="left" class="bar-subheader">
    <label class="item-input label-inset">
      <i class="icon ion-search placeholder-icon"></i>
      <input type="text" placeholder="Search" ng-model="search">
    </label>
  </ion-header-bar>
  <ion-content class="has-header has-subheader scrollBg">
  <ion-refresher pulling-txt="load" on-refresh="refresh()"></ion-refresher>
    <ion-list can-swipe="true">
    <p ng-show="transactions.length == 0" align="center"><br/>No saved transaction</p>
      <ion-item class="item item-icon-left" collection-repeat="t in transactions | filter:{to:search} | filter:isFromTo | orderBy:time:true" ng-click="checkStatus(t)">
        <i ng-show="t.block" ng-class="{'icon ion-arrow-graph-down-left balanced':t.to==account, 'icon ion-arrow-graph-up-right assertive':t.from==account}"></i>
        <i ng-show="!t.block" class="icon ion-load-c dark"></i>
        <h2 ng-class="{'balanced':t.to==account, 'assertive':t.from==account}">{{t.time | date: "yyyy-MM-dd HH:mm:ss"}}</h2>
        <h3>{{t.id | strLimit: 15 : 10}}</h3>
        <div ng-hide="isFriend(t.from)">From: {{t.from | strLimit: 15 : 5}}</div>
        <div ng-show="isFriend(t.from)">From: {{isFriend(t.from) | strLimit: 10 : 2}}</div>
        <div ng-hide="isFriend(t.to)">To: {{t.to | strLimit: 15 : 5}}</div>
        <div ng-show="isFriend(t.to)">To: {{isFriend(t.to) | strLimit: 10 : 2}}</div>
        <div><h3>Amount: {{(t.value/ t.unit) | currency:t.symbol + " ":6}}</h3></div> 
        <ion-option-button class="button-calm" ng-click="openInEtherscan('tx',t.id)">
          <i class="icon ion-link"></i>
        </ion-option-button>
        <ion-option-button ng-show="!t.block" class="button-positive" ng-click="checkStatus(t)">
          <i class="icon ion-ios-reload"></i>
        </ion-option-button>
        <ion-option-button class="button-assertive" ng-click="deleteTransaction(t)">
          <i class="icon ion-ios-trash"></i>
        </ion-option-button>
      </ion-item>
    </ion-list>
  </ion-content>
</ion-view>